package com.epower.bo.epowerwordfrequency.impl;

import java.util.List;
import javax.annotation.Resource;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import com.epower.bo.epowerwordfrequency.EpowerWordFrequencyService;
import com.epower.dao.epowerwordfrequency.EpowerWordFrequencyDAO;
import com.epower.dataobject.EpowerWordForDayDO;
import com.epower.dataobject.EpowerWordFrequencyDO;

@Scope("singleton")
@Component("epowerWordFrequencyBO")
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
public class EpowerWordFrequencyServiceImpl implements EpowerWordFrequencyService {

	private EpowerWordFrequencyDAO epowerWordFrequencyDAO;
 
	@Override
	public List<EpowerWordFrequencyDO> queryEpowerWordFrequencyBySpelling(String spelling) {
		return epowerWordFrequencyDAO.queryEpowerWordFrequencyBySpelling(spelling);
	}

	@Override
    public List<EpowerWordFrequencyDO> getEpowerWordFrequencyListPageByOption(EpowerWordFrequencyDO query) {
	    int totalItem = getEpowerWordFrequencyCountByOption(query);
	    query.setTotalItem(totalItem);
        return epowerWordFrequencyDAO.getEpowerWordFrequencyListPageByOption(query);
    }
	
	@Override
    public Integer getEpowerWordFrequencyCountByOption(EpowerWordFrequencyDO epowerWordForDay) {
        return epowerWordFrequencyDAO.getEpowerWordFrequencyCountByOption(epowerWordForDay);
    }
	
	public EpowerWordFrequencyDAO getEpowerWordFrequencyDAO() {
		return epowerWordFrequencyDAO;
	}

	@Resource
	public void setEpowerWordFrequencyDAO(EpowerWordFrequencyDAO epowerWordFrequencyDAO) {
		this.epowerWordFrequencyDAO = epowerWordFrequencyDAO;
	}

}
